package com.example.administrator.shihuo.adapters;

import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;

import java.util.List;

/**
 * Created by Bob on 2016/4/20.
 */
public abstract  class MyFragmentBaseAdapter<T> extends BaseAdapter {
    private List<T> mDatas;
    public MyFragmentBaseAdapter(List<T> datas){
        mDatas = datas;
    }
    @Override
    public int getCount() {
        return mDatas==null?0:mDatas.size();
    }

    @Override
    public T getItem(int position) {
        return mDatas.get(position);
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public abstract View getView(int position, View convertView, ViewGroup parent) ;
}
